// https://vuex.vuejs.org/zh-cn/intro.html
// make sure to call Vue.use(Vuex) if using a module system
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    baseurl:'http://s0.nsloop.com:36695',     
    uat:'',//用户认证
    openid:"",//获取openid
    wxUserInfo:'',//微信本地用户信息
    userInfo: '',//用户信息
    wxPhone:'',//微信手机号
    isAuthorization:'',//微信用户信息授权1未授权，2已授权
  },
  mutations: {
    getUat(state, payload) {
      //获取用户认证
      state.uat = payload;
    },
    getUserInfo(state, payload) {
      //获取用户信息
      state.userInfo = payload;
    },
    getOpenid(state, payload) {
      //获取用户信息
      state.openid = payload;
    },
    getWxPhone(state, payload) {
      //获取微信手机号
      state.wxPhone = payload;
    },
    getWxUserInfo(state, payload) {
      //获取微信本地用户信息
      state.wxUserInfo = payload;
    },
    getIsAuthorization(state, payload) {
      //微信用户信息授权
      state.isAuthorization = payload;
    },
  }
})

export default store
